package com.chinasofti.io;

import java.io.*;
import java.util.Arrays;

public class Demo13 {

    public static void main(String[] args) throws IOException {

        OutputStreamWriter osw =
                new OutputStreamWriter(new FileOutputStream("java419\\osw.txt"),"GBK");
        osw.write("中国");
        osw.close();

        InputStreamReader isr =
                new InputStreamReader(new FileInputStream("java419\\osw.txt"),"GBK");
        int ch;
        while((ch = isr.read()) != -1){
            System.out.print((char)ch);
        }
        isr.close();
    }
}